package com.znyj.servlet.sqlHelper;

/**
 * Created by nameless on 15-2-13.
 */
public class Limit {

    private int skip;
    private int number;
    private boolean isSkip;

    public Limit() {
    }

    public Limit(int number) {
        this.number = number;
        this.isSkip = false;
    }

    public Limit(int skip, int number) {
        this.skip = skip;
        this.number = number;
        this.isSkip = true;
    }

    public int getSkip() {
        return skip;
    }

    public void setSkip(int skip) {
        this.skip = skip;
    }

    public int getNumber() {
        return number;
    }

    public void setNumber(int number) {
        this.number = number;
    }

    public boolean isSkip() {
        return isSkip;
    }

    public void setSkip(boolean isSkip) {
        this.isSkip = isSkip;
    }

    @Override
    public String toString() {
        if (isSkip) {
            return "LIMIT " + number;
        }else {
            return "LIMIT " + skip + "," + number;
        }
    }
}
